import request from '@/util/request'
import store from '@/vuex/store'

// 查询每月收件量
export function queryApplyPerMouthApi(addressCode) {
    const value = {
        appKey: '',
        appFlag: 2,
        token: store.getters.token,
        versionCode: 0,
        param: addressCode
    }
    return request({
        url: 'static/applyMonth.do',
        method: 'post',
        data: value
    })
}

// 查询街道总量
export function staticStreetApi(addressCode) {
    const value = {
        appKey: '',
        appFlag: 2,
        token: store.getters.token,
        versionCode: 0,
        param: addressCode
    }
    return request({
        url: 'static/street.do',
        method: 'post',
        data: value
    })
}
//根据街道查询各阶段办件量
export function staticStateApi(townCode) {
    const value = {
        appKey: '',
        appFlag: 2,
        token: store.getters.token,
        versionCode: 0,
        param: townCode
    }
    return request({
        url: 'static/state.do',
        method: 'post',
        data: value
    })
}

//最快办件排行
export function enfficiencyApi(currentCode) {
    const value = {
        appKey: '',
        appFlag: 2,
        token: store.getters.token,
        versionCode: 0,
        param: currentCode
    }
    return request({
        url: 'static/efficiency.do',
        method: 'post',
        data: value
    })
}





//最快办件行政村列表查询
export function villageApi(code) {
    const value = {
        appKey: '',
        appFlag: 2,
        token: store.getters.token,
        versionCode: 0,
        param: code//通过当前村乡镇名查询
    }
    return request({
        url: 'static/village.do',
        method: 'post',
        data: value
    })
}


//村组社区完成订单查询
export function villageCountApi(code) {
    const value = {
        appKey: '',
        appFlag: 2,
        token: store.getters.token,
        versionCode: 0,
        param: code//通过当前村乡镇名查询
    }
    return request({
        url: 'static/villageCount.do',
        method: 'post',
        data: value
    })
}
//根据当前用户的currentCode去判断是区级账号还是乡镇账号
export function getVillageCount() {
    const value = {
        appKey: '',
        appFlag: 2,
        token: store.getters.token,
        versionCode: 0,
        param: store.getters.currentCode//通过当前村乡镇code查询
    }
    return request({
        url: 'static/getVillageCount.do',
        method: 'post',
        data: value
    })
}
//根据当前用户的currentCode决定详情操作栏是否显示
export function isShowChildInfo() {
    const value = {
        appKey: '',
        appFlag: 2,
        token: store.getters.token,
        versionCode: 0,
        param: store.getters.currentCode//通过当前村乡镇code查询
    }
    return request({
        url: 'static/isShowChildInfo.do',
        method: 'post',
        data: value
    })
}
//根据时间段和乡镇模糊查询
export function streetLikeSelect(list) {
    const value = {
        pageSize: list.pageSize,
        currentPage: list.currentPage,
        appKey: '',
        appFlag: 2,
        token: store.getters.token,
        versionCode: 0,
        param: JSON.stringify(list)
    }
    return request({
        url: 'static/streetLikeSelect.do',
        method: 'post',
        data: value
    })
}
//根据时间段和村组社区模糊查询
export function streetVillageLikeSelect(list) {
    const value = {
        pageSize: list.pageSize,
        currentPage: list.currentPage,
        appKey: '',
        appFlag: 2,
        token: store.getters.token,
        versionCode: 0,
        param: JSON.stringify(list)
    }
    return request({
        url: 'static/streetVillageLikeSelect.do',
        method: 'post',
        data: value
    })
}

//每天新增统计
export function everyDayNewApi(list) {
    const value = {
        appKey: '',
        appFlag: 2,
        token: store.getters.token,
        versionCode: 0,
        param: JSON.stringify(list)
    }
    return request({
        url: 'static/everyDayNew',
        method: 'post',
        data: value
    })
}
